<extend name="./Application/Admin/View/base.html" />
<block name="title"><title><?php echo C(APP_NAME);?>PC端管理</title></block>
<block name="stylesheets">
<link rel="stylesheet" href="__PUBLIC__/assets/css/jquery-ui.css" />
</block>
<block name="stylecss">
<style type='text/css'>
    table tr td{
        width: 80%;
    }
    table tr th{
        width: 16%;
        text-align: center;
        vertical-align: middle!important;
    }
</style>
</block>
<block name="smallmenu">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="{:U('Index/index')}">主页</a>
	</li>
    <li>
		<a href="{:U('Midiclub/index')}">机构列表</a>
	</li>
	<li class="active">添加机构</li>
</ul><!-- /.breadcrumb -->

<!-- #section:basics/content.searchbox -->
<div class="nav-search" id="nav-search"></div><!-- /.nav-search -->
</block>
<block name="content">
<div class="UploadBox">
<form action="__CONTROLLER__/midiclub_add" method='post' id='myformedit' class="myformedit" enctype="multipart/form-data">
<input type="hidden" name="action" value="midiclub_add_action">
<div class="row" style="margin-bottom:7px">
    <div class="col-xs-12"><span class="label label-info arrowed-in-right arrowed"><i class="ace-icon fa fa-flag bigger-120"></i> 基本信息</span></div>
</div>
<table class="table table-striped table-bordered table-hover" >
    <tr>
        <th>图片</th>
        <td>
            <div class="nfile_imgbox" >
                <input type="file" class="nfile" id="file_upload" name="pic" />
                <img src="__PUBLIC__/assets/images/addfile.png" id="preview">
                <a class="nimg_style">+<img src=""> </a>
            </div>
        </td>
    </tr>
    <tr>
        <th>名称</th>
        <td><input type="text" name='midiclub_name' class="col-xs-6 ninputxt">
        	<span class="Validform_checktip">必选项</span>
        </td>
    </tr>
    <tr>
        <th>联系电话</th>
        <td><input type="text" name='midiclub_phone' class="col-xs-6 ninputxt">
        <span class="Validform_checktip">必选项</span>
        </td>
    </tr>
    <tr>
        <th>等级</th>
        <td><select name="midiclub_level" id="" class="ninputxt col-xs-6">
            <option value="" >-请选择-</option>
            <option value="-1" >无等级</option>
            <option value="1" >初级</option>
            <option value="2" >中级</option>
            <option value="3" >高级</option>
            <option value="4" >特级</option>
        </select>
        <span class="Validform_checktip">必选项</span>
        </td>
    </tr>
    <tr>
        <th>类型</th>
        <td><select name="midiclub_type" id="" class="col-xs-6">
            <option value="" >-请选择-</option>
            <option value="1" >MIDICLUB</option>
            <option value="2" >考场</option>
            <option value="3" >MIDICLUB&考场</option>
            <option value="4" >其他机构</option>
        </select></td>
    </tr>
    <tr>
        <th>城市</th>
        <td><select name="midiclub_city"class="col-xs-6">
            <option value ="">-请选择-</option>
        <volist name="citys" id="vo">
            <option value ="{$vo.city_id}">{$vo.city_name}</option>
        </volist>
        </select>
        <span class="Validform_checktip">必选项</span>
        </td>
    </tr>
    <tr>
        <th>地址</th>
        <td><input type="text" name='midiclub_address' class="col-xs-6 ninputxt">
        	<span class="Validform_checktip">必填项</span>
        </td>
    </tr>
    <tr>
        <th>坐标经纬度</th>
        <td><div style='width:800px'>
            <div id="container" style="width:600px;height:365px"></div>
                <div style='color:#0066CC;font-size:16px;margin:30px 0'>
                提示：请先在地图中点选经纬度
                <div style="clear:both;margin:10px 0 15px 0;overflow:hidden">
                    <input type="text" id="lng" name="midiclub_lng" readonly="true" placeholder="请在地图上点选经度" class="col-xs-12 col-sm-8">
                </div>
                <div style="clear:both;margin:10px 0 15px 0;overflow:hidden">
                    <input type="text" id="lat" name="midiclub_lat" readonly="true" placeholder="请在地图上点选纬度" class="col-xs-12 col-sm-8">
                </div>
            </div>
        </div></td>
    </tr>
    <tr>
        <th>详情</th>
        <td><textarea name='midiclub_content' style="width:400px;height:100px" class="col-xs-6 ninputxt"></textarea>

        	<span class="Validform_checktip">必填项（请把内容介绍控制在十行）</span>
        </td>
    </tr>
    <tr>
        <td colspan="2"><button type="submit" class="btn btn-primary" onClick="">提交</button> <span class="btn" onClick="location.href='{:U('Midiclub/index')}'">返回</span></td>
    </tr>
</table>
</form>
</div>
</block>
<block name="scripts">
<script src="__PUBLIC__/assets/js/select2.js"></script>
</block>
<block name="scripts">
    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&amp;key=d9302ca02e1b7535c1109d5c51723896&amp;plugin=AMap.Autocomplete"></script>
</block>
<block name="jscript">
<script type="text/javascript">
    var map = new AMap.Map("container", {
        resizeEnable: true
    });
    //为地图注册click事件获取鼠标点击出的经纬度坐标
    var clickEventListener = map.on('click', function(e) {
        document.getElementById("lng").value = e.lnglat.getLng();
        document.getElementById("lat").value = e.lnglat.getLat();
    });
    var auto = new AMap.Autocomplete({
        input: "tipinput"
    });
    AMap.event.addListener(auto, "select", select);//注册监听，当选中某条记录时会触发
    function select(e) {
        if (e.poi && e.poi.location) {
            map.setZoom(15);
            map.setCenter(e.poi.location);
        }
    }
</script>
<script type="text/javascript">
    $(function(){
        $('#menu_midiclub').addClass('active open');
        $('#menu_midiclub_list').addClass('active');
    });
</script>
</block>